<?php
// +----------------------------------------------------------------------
// | 控制板框架
// +----------------------------------------------------------------------
// | @link ( http://www.yurnero.net )
// +----------------------------------------------------------------------
// | @copyright
// +----------------------------------------------------------------------
// | @licensed ( http://www.apache.org/licenses/LICENSE-2.0 )
// +----------------------------------------------------------------------
// | @author Haijun Wu <nicholasinlove@126.com>
// +----------------------------------------------------------------------
// | $Id: PublicAction.class.php 10 2011-02-06 08:35:48Z nicholasinlove1986@gmail.com $
// +----------------------------------------------------------------------


class PublicAction extends BaseAction {

	public function index() {
		redirect(__APP__);
	}

	//左侧菜单
	public function menu() {
		C ('SHOW_RUN_TIME', false);  // 关闭运行时间显示
		C ('SHOW_PAGE_TRACE', false);
		$this->display();
	}

	//左栏移动帧
	public function drag() {
		C ('SHOW_RUN_TIME', false);
		C ('SHOW_PAGE_TRACE', false);
		$this->display();
	}

	//头部
	public function top() {
		C ('SHOW_RUN_TIME', false);
		C ('SHOW_PAGE_TRACE', false);
		$this->display();
	}

	//后台起始页
	public function main() {		
		$db = M();
		$db_ver = $db->query('select version();');
		$db_ver = $db_ver[0]['version()'];
		//print_r($GLOBALS['_CFG']);
		//系统信息 
		$gd                             =  gd_info();		
		$sys_info['os']                 =  PHP_OS;
		$sys_info['ip']                 =  $_SERVER['SERVER_ADDR'];
		$sys_info['web_server']         =  $_SERVER['SERVER_SOFTWARE'];
		$sys_info['php_ver']            =  PHP_VERSION;
		$sys_info['mysql_ver']          =  $db_ver;
		$sys_info['php_handler']        =  php_sapi_name();
		$sys_info['ThinkPHP']           =  THINK_VERSION.' [ <a href="http://thinkphp.cn" target="_blank">'.L('thinkphp_new_version').'</a> ]';
		$sys_info['http']               =  $_SERVER['SERVER_PROTOCOL'];
		$sys_info['root']               =  $_SERVER['DOCUMENT_ROOT'];
		$sys_info['max_filesize']       =  ini_get('file_uploads') ? ini_get('upload_max_filesize') : '<span>Disabled</span>';
		$sys_info['max_execution_time'] =  ini_get('max_execution_time').' seconds';
		$sys_info['Zend_Optimizer']     =  defined("OPTIMIZER_VERSION") ? OPTIMIZER_VERSION : L('no_zend_optimizer');
		$sys_info['FreeType']           =  $gd['FreeType Support'] ? '<span>Supported</span>' : '<span>Not supported</span>';
		$sys_info['register_globals']   =  get_cfg_var('register_globals') ? L('yes') : L('no');
		$sys_info['zlib']               =  function_exists('gzclose') ? L('yes') : L('no');
		$sys_info['safe_mode']          =  (boolean) ini_get('safe_mode') ?  L('yes') : L('no');
		$sys_info['safe_mode_gid']      =  (boolean) ini_get('safe_mode_gid') ? L('yes') : L('no');
		$sys_info['timezone']           =  function_exists("date_default_timezone_get") ? date_default_timezone_get() : L('no_timezone');
		$sys_info['socket']             =  function_exists('fsockopen') ? L('yes') : L('no');
		
		$this->assign('sys_info',$sys_info);
		$this->display();
	}

	//尾部
	public function footer() {
		C('SHOW_RUN_TIME',false);
		C('SHOW_PAGE_TRACE',false);
		$this->display();
	}
	
	//关于
	public function about() {
		$this->display();
	}	
		
}

?>
